package com.atcd.sonw.sonwflaketest.service;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import org.springframework.stereotype.Service;

@Service
public class OrderService {

private  long workId = 0L;  //0-31 几号机房
private  long datacenterId=1L; // 几号机器
    public  String  get(){

        Snowflake snowflake = IdUtil.getSnowflake(workId,datacenterId);
        return snowflake.nextIdStr();
    }
}
